#pragma once
#include <iostream>
#include <string>
using namespace std;

class person
{
public:
    string _name;
};

class student : virtual public person
{
public:
    int _stuid;
};

class teacher : virtual public person
{
public:
    int _jobid;
};

class assitant : public student, public teacher
{
public:
    int _major_course;
};

void test_7()
{
    assitant a;
    a._stuid = 1;
    a._jobid = 2;

    a.student::_name = "小张";
    a.teacher::_name = "老张";
}

struct A
{
    int _a1;
    int _a2;
};

struct B : virtual public A
{
    int _b1;
    int _b2;
};

struct C : virtual public A
{
    int _c1;
    int _c2;
};

struct D : public B, public C
{
    int _d;
};

void test_8()
{
    // D d;
    // d.B::_a1 = 0xBA1;
    // d.B::_a2 = 0xBA2;
    // d.B::_b1 = 0xBB1;
    // d.B::_b2 = 0xBB2;
    // 
    // d.C::_a1 = 0xCA1;
    // d.C::_a2 = 0xCA2;
    // d.C::_c1 = 0xCC1;
    // d.C::_c2 = 0xCC2;

    // d.D::_d = 0xDD;

    // D d;
    //
    // B* pb = &d;
    // C* pc = &d;
    //
    // cout << pb << endl;
    // cout << pc << endl;

    D d1, d2, d3, d4;
}
